Skip to content

[feat] /sessions \uac80\uc0c9\u00b7\ud544\ud130 (#14)#38

Merged
peterabcd merged 1 commit into
devfrom
feat/sessions-search-filter
Jun 7, 2026
Merged

[feat] /sessions \uac80\uc0c9\u00b7\ud544\ud130 (#14)#38
peterabcd merged 1 commit into
devfrom
feat/sessions-search-filter

Conversation

@peterabcd

Copy link
Copy Markdown
Collaborator

closes #14

요약

/sessions 상단에 필터 UI. URL 쿼리와 완전 동기화돼서 필터 결과 URL 을 그대로 공유 가능.

필터 항목

  • 장소 (substring; SQLite LIKE)
  • 참여 멤버 (participations.some.userId)
  • 월 (YYYY-MM; UTC 기준 month boundary)
  • 참여 인원 min ~ max (Prisma 가 relation _count where 미지원 → $queryRaw 로 id 추출 후 id: { in } 구성)

주요 변경

  • lib/sessions.ts: SessionFilters + listApprovedMembers() + raw 기반 참여 수 필터
  • app/sessions/_components/FilterBar.tsx: GET form 서버 컴포넌트. 제출 시 URL 교체로 cursor 자동 리셋.
  • app/sessions/page.tsx: searchParams 파싱, filter pass-through, "더 보기" 링크가 현재 필터를 유지한 상태로 cursor 만 갈아끼움.

머릿속 테스트 (negative case)

  • 조건 겄는데 결과 없음 → EmptyState 대신 "조건에 맞는 세션이 없어요" + 입문 필터 초기화 링크.
  • pmin > pmax: 끌려서 빈 결과 표시. 클라이언트에서 명시 검증은 뜨로 두지 않음 — 항상 결과 존재하는 고정 범위가 아닌데 어설프게 잉어넣면 사용자도 답을 판단 가능.
  • cursor 접혈 안 된 필터 조합: nextCursor 로 넘어가더라도 cursor 외 파라미터 그대로 전송.

검증

  • pnpm check 통과.
  • 수동 E2E는 대표 테스트로: 장소="서울", 멤버=특정 user, 참여 2~5, 월 2026-06 조합 적용 → URL ?q=&member=&month=&pmin=&pmax= 가 유지되고 cursor 동작.

@peterabcd peterabcd merged commit 3e9d24a into dev Jun 7, 2026
1 check passed
@peterabcd peterabcd deleted the feat/sessions-search-filter branch June 7, 2026 07:05
@peterabcd peterabcd mentioned this pull request Jun 7, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant